<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>我的收货地址</title>
    <link rel="stylesheet" th:href="@{/bootstrap/css/bootstrap.min.css}">
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}">
    <style>
    form{
        margin: 100px auto;
        list-style: none;
    }
    .btn1{
        margin: 0 40%;
    }
    </style>
</head>
<body>
    <div th:insert="~{public/publicTop::top}"></div>
    <div style="width: 70%;margin: auto;text-align: center;margin-top: 3rem;">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend>地址管理</legend>
        </fieldset>
        <table class="table" style="margin-top: 2rem;">
            <tr th:each="address:${addresses}">
                <td th:text="${address.getName()}"></td>
                <td th:text="${address.getPhone()}"></td>
                <td >
                    <p style="display: inline;" class="glyphicon glyphicon-home"></p>
                    <p style="display: inline;" th:text="${address.getAddress()}"></p>
                </td>
                <td>
                    <a th:href="@{'/account/edit/'+${address.getId()}}" class="glyphicon glyphicon-pencil"></a>&nbsp;&nbsp;
                    <a th:href="@{'/account/del/'+${address.getId()}}" class="glyphicon glyphicon-remove"></a>
                </td>
            </tr>
        </table>
        <a class="btn btn-success btn1" th:href="@{/account/toadd}">+ 添加收货地址</a>
    </div>
</body>
</html>